import request from '@/utils/request'
// 获取员工列表
export const getEmployeesListAPI = (query) => {
  return request({
    method: 'get',
    url: '/sys/user',
    params: query
  })
}
// 删除员工
export const delEmployee = (id) => {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`

  })
}
// 新增员工:一次新增一个
export const addEmployeeAPI = (employeeForm) => {
  return request({
    method: 'post',
    url: '/sys/user',
    data: employeeForm
  })
}
// 批量导入员工
export const AddMoreEmployeeAPI = (employeeList) => {
  return request({
    method: 'post',
    url: '/sys/user/batch',
    data: employeeList
  })
}
// 获取员工基本信息
export const employeInfo = (id) => {
  return request({
    method: 'get',
    url: `/sys/user/${id}`
  })
}
export const upDateEmployeeAPI = (employeeForm) => {
  return request({
    method: 'put',
    url: `/sys/user/${employeeForm.id}`,
    data: employeeForm
  })
}

// 员工分配角色
export const assignRoleAPI = (id, roleIds) => {
  return request({
    method: 'put',
    url: '/sys/user/assignRoles',
    data: { id, roleIds }
  })
}
